<template>
    <div>
        <van-nav-bar title="张三"  left-arrow   @click-left="onClickLeft"
  @click-right="onClickRight">
            <template #right>
                <van-icon name="star-o" size="18"  v-if="onclick" />
                <van-icon name="star" size="18"  v-if="!onclick" />
            </template>
        </van-nav-bar>
    </div>
</template>
    
<script>
import { NavBar } from "vant";
export default {
    data(){
        return {
            onclick: true 
        }
    },
    name: "attentionReturn",
    components: {
        VanNavBar: NavBar,
    },
    props: {
        title: {
            type: String,
            default: "",
        },
        leftArrow: {
            type: Boolean,
            default: true,
        },
        rightText: {
            type: String,
            default: ''
        }
    },
    methods: {
        onClickLeft() {
            this.$router.go(-1)
        },
        onClickRight(){
            this.onclick = !this.onclick
        }
    },
};
</script>